package main

import (
	"fmt"
	"t"
)

func main() {
	s := "abcabcbb"
	// s := "bbtablud"
	fmt.Println(t.LengthOfLongestSubstring(s))
}

type ListNode struct {
	Val  int
	Next *ListNode
}

func initLink() *ListNode {
	head := &ListNode{
		Val: 1,
		Next: &ListNode{
			Val: 2,
			Next: &ListNode{
				Val: 3,
				Next: &ListNode{
					Val: 4,
					Next: &ListNode{
						Val:  5,
						Next: nil,
					},
				},
			},
		},
	}
	return head
}

func prtLink(link *ListNode) {
	cur := link
	for cur != nil {
		fmt.Println(cur.Val)
		cur = cur.Next
	}
}

func LinkReverse(link *ListNode) *ListNode {
	pre := link
	cur := &ListNode{
		Val:  0,
		Next: nil,
	}
	for pre != nil {
		next := pre.Next
		pre.Next = cur
		cur = pre
		pre = next
	}
	return cur
}
